package com.niuwa.p2p.core.utils;

import java.io.IOException;
import java.util.Properties;

/**
 * @ClassName: PropertiesUtil
 * @Description: 系统级参数工具类
 * @author: niuwa5
 * @date:2015年1月13日 下午3:33:54
 */
public class PropertiesUtil {

	/**
	 * 获取系统配置参数
	 * 
	 * @return Properties
	 * @throws IOException
	 */
	public static Properties getProperties() throws IOException {
		return (Properties) ApplicationContextUtil.getApplicationContext()
				.getBean("propertiesReader");
	}

	/**
	 * @Description: 根据key获取Value
	 * @param property
	 *            key
	 * @return property value
	 * @throws IOException
	 */
	public static String getProperty(String key)  {
		try {
			return getProperties().getProperty(key);
		} catch (IOException e) {
			e.printStackTrace();
			return "";
		}
	}

}
